package com.bigshen.spring.framework.webmvc.servlet;

import com.bigshen.spring.framework.context.ApplicationContext;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author eddy.shen
 * @Date 2020/4/18 11:19
 **/
public class DispatcherServlet extends HttpServlet {

    private ApplicationContext context;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    public void init(ServletConfig config) throws ServletException {

        // 创建Spring上下文，并在其中进行 IOC、DI、AOP操作
        context = new ApplicationContext(config.getInitParameter("contextConfigLocation"));



        // 初始化Spring九大组件

    }

}
